<!-- 修改密码 BEGIN -->
<div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" aria-hidden="true"
  id="password">
  <div class="modal-dialog delete-modal password-modal modal-dialog-centered">
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title">用户管理 - 修改密码</h4>
      </div>

      <div class="modal-body text-center">
        <form novalidate name="formpassword" #myform="ngForm">
          <div class="form-group">
            <label class="col-xs-12 col-sm-3 control-label text-right">原密码：</label>
            <div class="col-xs-12 col-sm-9">
              <input type="password" class="form-control" pPassword name="oldPasswords" #oldPasswords=ngModel [(ngModel)]="updateData.oldPasswords"
                (input)="originalPassword()" placeholder="请输入原密码" required/>
              <div *ngIf="oldPasswords.invalid && (oldPasswords.touched)" class="error-alert text-left">
                <div *ngIf="oldPasswords.errors.required">
                  <small class="error">密码不能为空</small>
                </div>
              </div>
              <div class="error text-left"  *ngIf="oldPassword == false && updateData.oldPasswords!==''">
                <small class="error">原始密码不正确</small>
              </div>
            </div>
          </div>
          <div class="form-group">
            <label class="col-xs-12 col-sm-3 control-label text-right">新密码：</label>
            <div class="col-xs-12 col-sm-9">
              <input type="password" name="uselessPassword" pPassword #uselessPassword=ngModel autocomplete="off" class="form-control" [(ngModel)]="updateData.uselessPassword"
                placeholder="请输入新密码" required/>
              <div class="error text-left" *ngIf="uselessPassword.invalid && (uselessPassword.touched)">
                <small class="error" *ngIf="uselessPassword.errors.required">密码不能为空</small>
              </div>
            </div>
          </div>
          <div class="form-group height-auto">
            <label class="col-xs-12 col-sm-3 control-label text-right">确认密码：</label>
            <div class="col-xs-12 col-sm-9">
              <input type="password" name="newPassword" #newPassword=ngModel autocomplete="off" class="form-control" [(ngModel)]="updateData.newPassword"
                placeholder="请再次输入新密码" required/>
              <div class="error text-left" *ngIf="newPassword.invalid && ( newPassword.touched)">
                <small class="error" *ngIf="newPassword.errors.required">密码不能为空</small>

              </div>
              <div class="error text-left" *ngIf="(newPassword.touched)">
                <small class="error" *ngIf="updateData.uselessPassword != updateData.newPassword && updateData.newPassword!==''">请保持密码一致</small>
              </div>
            </div>
          </div>
        </form>
      </div>
      <div class="modal-footer">
          <button type="button" class="btn btn-default" mat-raised-button (click)="reset()">取消</button>
          <button type="submit" mat-button class="btn btn-primary confirm-del-btn" 
          [disabled]="!myform.form.valid || updateData.uselessPassword != updateData.newPassword || oldPassword == false" 
          (click)="updatepassword()">保存</button>

      </div>
    </div>
  </div>
</div>
<!-- 修改密码 END -->